package com.example.topicfromjinzhuan2024national

import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.view.Window
import android.view.WindowManager
import com.example.topicfromjinzhuan2024national.databinding.ActivityMainBinding

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        requestWindowFeature(Window.FEATURE_NO_TITLE)
        window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN)
        var binding=ActivityMainBinding.inflate(layoutInflater)
        setContentView(binding.root)

        var handler= Handler(Looper.myLooper()!!)
        Thread{
            Thread.sleep(1000)
            handler.post {
                binding.textTime.setText("2")
            }
            Thread.sleep(1000)
            handler.post {
                binding.textTime.setText("1")
            }
            Thread.sleep(1000)
            handler.post {
                binding.textTime.setText("0")
            }
            startActivity(Intent(applicationContext,Home::class.java))
        }.start()
    }
}